<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');



// ------------------------------------------------------------------------

/**
 * Display Message
 *
 * Create a local URL based on your basepath. Segments can be passed via the
 * first parameter either as a string or an array.
 *
 * @access	public
 * @param	string
 * @return	string
 */
if ( ! function_exists('flash_message'))
{
	function flash_message()
	{
			// get flash message from CI instance
			
			$CI =& get_instance();
			$flashmsg = $CI->session->flashdata('message');							$class= "";							switch ($flashmsg['type']) {
				case 'ERROR':
					$class = "alert alert-error";
					break;									case 'SUCCESS':					$class ="alert alert-success";					break;									case 'INFORMATION':					$class ="alert alert-info";									break;	
								case 'WARNING':					$class ="alert alert-block";				break;				
				default:
					
					break;
			}					
		
			$html = '';
			if (is_array($flashmsg))
			{
				$html = '<div id="flashmessage" class="'.$class.'"><button type="button" class="close" data-dismiss="alert">×</button><h4 class="alert-heading">'.$flashmsg['title'].'</h4>'.$flashmsg['content'].'</div>';
			}
			return $html;
	}
	
}



?>